<template>
  <div id="loader-wrapper">
    <div id="loader"></div>
    <div class="loader-section section-left"></div>
    <div class="loader-section section-right"></div>
    <div class="load_title">正在加载,请耐心等待</div>
  </div>
</template>

<script>
import { getAction } from '@/api/manage'
export default {
  name: "Skip",
  beforeCreate() {
    getAction('/isc/isc_server_url').then((res) => {
      let serviceUrl = encodeURIComponent(window._CONFIG["serviceURL"]);
      let to = res.data.iscServerUrl;
      if (this.$route.query.type === "logout") {
        to += "/logout?service=" + serviceUrl;
        if (this.$route.query.username) {
          to += "&username=" + this.$route.query.username;
        }
      } else {
        to += "/login?service=" + serviceUrl;
      }
      window.location.href = to;
    });
  },
};
</script>

<style lang="less">
@import "~@assets/less/common.less";
</style>